<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all"/>
    <link rel="stylesheet" href="{:_SKIN}/shadmin/v3//css/news.css" media="all"/>
</head>
<body class="childrenBody">
<blockquote class="layui-elem-quote mylog-info-tit">
    

    <div class="layui-inline">
        <a class="layui-btn layui-btn-danger  roleAdd_btn" href="{:url('jd')}"> <i class="layui-icon larry-icon "></i>新增景点</a>
    </div>


    

    <div class="layui-inline">
        <div class="layui-form-mid layui-word-aux">　共找到 {:count($list)} 个</div>
    </div>


</blockquote>

<div class="layui-form news_list">
    <table class="layui-table">
        <colgroup>
            <col width="50">
            <col>
            <col width="15%">
            <col width="15%">
            <col width="15%">
            <col width="15%">
           
            <col width="15%">
        </colgroup>
        <thead>
        <tr>
            <th></th>
            <th style="text-align:left;">产品</th>
            <th>产品图片</th>
            <th>所属商家</th>
             <th>价格</th>
            <th>发布时间</th>
             <th>发布人</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody class="news_content">
        {volist name="list" id="v"}
        <tr>
            <td><input type="checkbox" name="checked" lay-skin="primary" lay-filter="choose">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon"></i></div>
            </td>
            <td align="left" class=" v_product ">{$v.name}</td>
            <td> <a class="pic" data-url="{:config('cdn')}{$v.pic}"><i class="layui-icon">&#xe64a;</i> 预览</a>   </td>

            <td>{$v.cate}</td>
             <td>{$v.price}</td>
           

            

           


            <td>{$v.addtime}</td>
             <td>{$v.addname}</td>
            <td>

               

                
                <a class="layui-btn  layui-btn-mini" href="{:Url('jd',['id'=>$v['id']])}" >编辑</a>
                <a class="layui-btn layui-btn-danger layui-btn-mini pro_del" data-id="{$v.id}">删除</a>


            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
</div>

<div id="page">{$page}</div>
{:jq()}
{:layui()}
<style>
    .pagination {
        margin-left: 50px;
    }

    .pagination li {
        float: left;
        background: #34a8fe;
        color: #fff;
        margin-right: 8px;
    }

    .pagination li a, .pagination li span {
        color: #fff;
        padding: 8px 10px;
        display: block
    }

    .pagination .active {
        background-color: #fe6738
    }

</style>
<script>

    //检索产品

    $(".pic").click(function(){

  var url=$(this).data('url'); 

parent.layer.open({
  type: 1,
  title: false,
  closeBtn: 0,
  area: '516px',
  skin: 'layui-layer-nobg', //没有背景色
  shadeClose: true,
  content: "<img src='"+url+"' />"
});
    





    });


    //删除商品
    $(".pro_del").click(function () {
        var id = $(this).data('id');
        parent.layer.confirm("确定要删除该商品吗？删除后不可恢复", function () {

            $.post("{:url('dev/delapi')}", {t: 'tour_product',k:'id',v:id}, function (res) {



                if (res.code == 200) {


                    parent.layer.msg('删除成功', {shift: 0, time: 800}, function () {

                        location.reload();
                    });

                } else {

                    parent.layer.msg(res.msg);

                }

            });


        });


    });



  

   

</script>
</body>
</html>